-module(es_util).
-export([timestamp_now/0, test/0]).

iso_8601_fmt(DateTime) ->
    {{Year,Month,Day},{Hour,Min,Sec}} = DateTime,
    io_lib:format("~4.10.0B-~2.10.0B-~2.10.0B ~2.10.0B:~2.10.0B:~2.10.0B",
        [Year, Month, Day, Hour, Min, Sec]).

timestamp_now() ->
    lists:flatten(iso_8601_fmt(erlang:universaltime())).

test() ->
    ok.